<template>
	<view>
		<inviteList @myEven="on_tab(0)" :list="invite_List" :islog="islog" :log="log" :tabindex="tabindex"></inviteList>
	</view>
</template>
<script>
	import inviteList from "@/pages/list/invitelist.vue";
	export default {
		components: {
			inviteList
		},
		data() {
			return {
				invite_List: [],
				islog: true,
				page: 1,
				itype: '',
				limit: 5,
			};
		},
		onShow() {
			this.$module.ifToken(res => {
				this.islog = true
				if (res == 1) {
					this.$module.navigateTo('/pages/banmi/user_login')
				} else {
					this.islog = true
					this.getlist() //获取数据
					return
				}
			})
		},
		methods: {
			onReachBottom() {
				this.jiazai = "加载中...";
				this.page += 1;
				if (this.page > this.totalPage) {
					this.$module.showToast("已经到底了")
					return
				} else {
					this.getlist()
				}
			},
			getlist() { //获取数据信息
				var that = this;
				let data = {
					data
				}
				let requestParams = {
					limit: this.limit,
					page: this.page,
				};
				this.$module.sm(requestParams, 1, res => {
					data.data = res
				})
				this.Htpp.post('/mehrb/meplus/invite/page', 'app', {
					datalist: data
				}).then(ret => {
					that.$module.sm(ret, 2, res => {
						this.totalPage = res.data.totalPage
						if (that.page == 1) {
							this.invite_List = res.data.list;
						} else {
							if (res.data.list.length > 0) {
								for (var i = 0; i < res.data.list.length; i++) {
									this.invite_List.push(res.data.list[i]);
								}
							}
							if (res.data.list.length < 10) {
								this.log = "没有数据了"
								return
							}
						}
						setTimeout(() => {
							that.isinit = false;
							that.islog = false;
						}, 100)
					})
				})
			}
		}
	}
</script>

<style lang="less">
page{
	background-color: #fff;
}
</style>